package com.kun.controller.admin;

import com.kun.entity.Comment;
import com.kun.result.Result;
import com.kun.service.impl.CommentServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @descriptions: 后台评论审核
 * @author: SunKun
 * @date: 2021/7/16 0016 15:28
 * @version: 1.0
 */
@RestController
@CrossOrigin  //允许跨域
@ResponseBody
@RequestMapping("/kun/admin/comment")
public class CommentAdminController {
    @Autowired
    private CommentServiceImpl commentService;

    /**
     * 更改评论
     * @param comment
     * @return
     */
    @PostMapping("/updateComment")
    public Result updateComment(@RequestBody Comment comment){
        return commentService.updateComment(comment) != 0 ? Result.ok() : Result.error();
    }
}
